﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GDoc.Web.Models;

namespace GDoc.Web.Controllers
{
    public class HomeController : _ControllerBase
    {
        public ActionResult Index()
        {
            if (!Request.IsAuthenticated)
            {
                ViewBag.Message = "Welcome to GDoc, the app that makes easy the management of your digital documents.";

                return View();
            }
            else
            {
                if (HasAccountSelected)
                    return RedirectToAction("Index", "Account", new { id = GetCurrentAccount().Id });

                return RedirectToAction("Select", "Account");
            }
        }

        public ActionResult Help()
        {
            ViewBag.SelectedMenu = "about";
            return View();
        }
    }
}
